﻿
/*----------------------------------------------------------------//
// 文件名：MoDirFile.cs
// 文件功能描述：实体 MoDirFile.
// 
// 创建标识：2009-03-10
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoDirFile
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoDirFile
	/// </summary>
	public partial class MoDirFile:ICloneable
	{
		#region 表DirFile的字段
		private string _df_id;
		private string _uid;
		private string _parent_did;
		private string _df_name;
		private string _df_flag;
		private string _rem;
		private DateTime _create_time;
		#endregion
		
		#region 构造函数
		public MoDirFile()
		{
		    
		    
		    
		    
		    
		    
		    _create_time= DateTime.Now;
		}
		#endregion
		
		#region 拷贝构造函数

		public MoDirFile(MoDirFile item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoDirFile(string df_id,string uid,string parent_did,string df_name,string df_flag,string rem,DateTime create_time)
		{
		this._df_id=df_id;
		this._uid=uid;
		this._parent_did=parent_did;
		this._df_name=df_name;
		this._df_flag=df_flag;
		this._rem=rem;
		this._create_time=create_time;
		}
		#endregion
		
		#region 表DirFile的字段属性
		/// <summary>
		///目前使用GUID来表达。也可以考虑使用UDF来实现。
		/// </summary>
		public string Df_Id
		{
			get {return _df_id;}
			set {_df_id=value;}
		}
		/// <summary>
		/// UID
		/// </summary>
		public string Uid
		{
			get {return _uid;}
			set {_uid=value;}
		}
		/// <summary>
		///目前使用GUID来表达。也可以考虑使用UDF来实现。
		/// </summary>
		public string Parent_Did
		{
			get {return _parent_did;}
			set {_parent_did=value;}
		}
		/// <summary>
		///上传时，本地的文件名称。含扩展名。
		/// </summary>
		public string Df_Name
		{
			get {return _df_name;}
			set {_df_name=value;}
		}
		/// <summary>
		///根，目录，文件
		/// </summary>
		public string Df_Flag
		{
			get {return _df_flag;}
			set {_df_flag=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		/// <summary>
		/// CREATE_TIME
		/// </summary>
		public DateTime Create_Time
		{
			get {return _create_time;}
			set {_create_time=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoDirFile CopyTo(MoDirFile item)
        {
		    item.Df_Id=this.Df_Id;
		    item.Uid=this.Uid;
		    item.Parent_Did=this.Parent_Did;
		    item.Df_Name=this.Df_Name;
		    item.Df_Flag=this.Df_Flag;
		    item.Rem=this.Rem;
		    item.Create_Time=this.Create_Time;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoDirFile NewDirFile=new MoDirFile();
		    NewDirFile._df_id=this._df_id;
		    NewDirFile._uid=this._uid;
		    NewDirFile._parent_did=this._parent_did;
		    NewDirFile._df_name=this._df_name;
		    NewDirFile._df_flag=this._df_flag;
		    NewDirFile._rem=this._rem;
		    NewDirFile._create_time=this._create_time;
			return NewDirFile;
		}
		
		private static MoDirFile _empty = new MoDirFile(string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,DateTime.MinValue);
        public static MoDirFile Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoDirFile NewDirFile = obj as MoDirFile;
                if (NewDirFile == null)
                {
                    return false;
                }
                else
                {
				if (NewDirFile.Df_Id==this.Df_Id && NewDirFile.Uid==this.Uid && NewDirFile.Parent_Did==this.Parent_Did && NewDirFile.Df_Name==this.Df_Name && NewDirFile.Df_Flag==this.Df_Flag && NewDirFile.Rem==this.Rem && NewDirFile.Create_Time==this.Create_Time)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Df_Id={0}/Uid={1}/Parent_Did={2}/Df_Name={3}/Df_Flag={4}/Rem={5}/Create_Time={6}",_df_id,_uid,_parent_did,_df_name,_df_flag,_rem,_create_time);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["DF_ID"]!=null && row["DF_ID"]!=DBNull.Value)
			{
			    this.Df_Id = (string)row["DF_ID"];
			}
			else
			{
				this.Df_Id =string.Empty;
			}
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Parent_DID"]!=null && row["Parent_DID"]!=DBNull.Value)
			{
			    this.Parent_Did = (string)row["Parent_DID"];
			}
			else
			{
				this.Parent_Did =string.Empty;
			}
		    if(row["DF_Name"]!=null && row["DF_Name"]!=DBNull.Value)
			{
			    this.Df_Name = (string)row["DF_Name"];
			}
			else
			{
				this.Df_Name =string.Empty;
			}
		    if(row["DF_Flag"]!=null && row["DF_Flag"]!=DBNull.Value)
			{
			    this.Df_Flag = (string)row["DF_Flag"];
			}
			else
			{
				this.Df_Flag =string.Empty;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		    if(row["Create_Time"]!=null && row["Create_Time"]!=DBNull.Value)
			{
			    this.Create_Time = (DateTime)row["Create_Time"];
			}
			else
			{
				this.Create_Time =DateTime.MinValue;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["DF_ID"] = this.Df_Id;
			row["UID"] = this.Uid;
			row["Parent_DID"] = this.Parent_Did;
			row["DF_Name"] = this.Df_Name;
			row["DF_Flag"] = this.Df_Flag;
			row["Rem"] = this.Rem;
			row["Create_Time"] = this.Create_Time;
		}
		#endregion
	}
}
#endregion
